<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"+ request.getServerName() + ":" + request.getServerPort()+ path + "/";
%>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=9">
        <link rel="stylesheet" href="<%=basePath %>css/cssreset.css">
        <link rel="stylesheet" href="<%=basePath %>css/gongao.css">
        <link rel="stylesheet" href="<%=basePath %>css/daohang.css">
        <script src="<%=basePath %>js/jquery-1.11.1.min.js"></script>
        <script src="<%=basePath %>js/menu.js"></script>
        <style>
        	a{
        		text-decoration:none;
        		color:#708dac;
        	}
        	.psxa{
			color:#708dac;
			width:100%;
			line-height:23px;
			text-align: center;
			margin-top:27px;
			font-family: '微软雅黑';
			cursor:pointer;
			font-size:16px;
		}
		.ims{
			position:relative;
			top:4px;
			right:22px;
		}
        </style>
    </head>
    <body>
    	<div class="headers">
    		<p class="pa">客户管理系统CRM</p>
    		<p class="rights">
	    		<img src="<%=basePath %>images/user.png" alt="">
	    		${staff.staff_name}
	    		<button onclick="ind()"></button>
    		</p>
    	</div>
    	<section>
    		<ol class="lefts">
    			<li class="pb">
    				<img src="<%=basePath %>images/Users and permissions.png" alt="">
    				用户和权限
    				<img src="<%=basePath %>images/button (2).png" alt="">
    				<div class="div1">
    					<p class="zcd" id="zcd1"><a href="<%=basePath %>role/page.action">角色管理</a></p>
						<p class="zcd" id="zcd2"><a href="<%=basePath %>staff/selectTree.action">部门/用户管理</a></p>
    				</div>
    			</li>
    			<li class="px">
    				<img src="<%=basePath %>images/canshu.png" alt="">
    				业务参数和设定
    				<img src="<%=basePath %>images/button (2).png" alt="">
    				<div class="div1">
    					<%-- <p class="zcd" id="zcd1" name="ppa"><a href="<%=basePath %>tradeManage/select.action">行业管理</a></p>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>compactGenre/select.action">合同类型</a></p>
                        <p class="zcd" id="zcd1" name="ppa"><a href="<%=basePath %>rank/select.action">客户级别</a></p>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>salestage/select.action">来源渠道</a></p>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>salestage/select.action">销售阶段</a></p> --%>
                        <p class="zcd" id="zcd2" name="ppa"><a href="<%=basePath %>record/select.action">来源渠道</a></p>
    				</div>
    			</li>
                <li class="py">
                    <img src="<%=basePath %>images/liucheng.png" />
                    	流程管理
                    <img src="<%=basePath %>images/button (2).png" />
                    <div class="div1">
                        <p class="zcd" id="zcd1"><a href="<%=basePath %>approveRole/select.action">审批流程管理</a></p>
                        <p class="zcd" id="zcd1"><a href="<%=basePath%>approve/count.action?pageSize=2" >已审批流程查看</a></p>
                    </div>
                </li>
                <li class="pxa">
                    <img src="../images/gonggao.png" alt="" width="18px">
                    <a href="../notice/page.action" style="color:#708dac;text-decoration: none; color:#fff;">公告管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
                </li>
                 <li class="pxaa">
                    <img src="../images/kehu (1).png" alt="">
                    		资源开发
                    <img src="../images/button (2).png" alt="">
                    <div class="div1">
                        <p class="zcd" id="zcd1"><a href="<%=basePath %>client/weifencount.action?zhuizong=0">用户开发</a></p>
                        <p class="zcd" id="zcd2"><a href="../client/findByAllForAgent.action?start=1">代理开发</a></p>
                    </div>
                </li> 
                 <%-- <li class="pxas">
    				<img src="../images/kehuzilao.png" alt="">
    				客户资料
    				<img src="../images/button (2).png" alt="">
    				<div class="div1" >
    					<p class="zcd" id="zcd1"><a href="<%=basePath%>client/findByAllData.action?start=1">用户资料</a></p>
						<p class="zcd" id="zcd2"><a href="<%=basePath%>client/findByAllData.action">代理资料</a></p>
    				</div>
    			</li> --%>
    			<li class="psxa">
    				<img src="../images/operation-management.png" alt="" width="16px" class="ims">
    				<a href="#">运营管理&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a>
    			</li> 
    		</ol>
    		<div class="righta">
    			<div class="smalls">
    				<p class="pj">公告管理</p>
    				<div class="pjs">
    					<div class="pjss">
    						<p class="pjssa"><a href="<%=basePath %>html/gongao.jsp"style="color:#fff;">发布公告</a></p>
    						<p class="pjssb"><a href="<%=basePath %>notice/page.action" style="color:#555555;">已发布公告</a></p>
    					</div>
    					<form action="" method="post" onsubmit="return fabu()">
    						<textarea name="" id="tarea" cols="30" rows="10" placeholder="&nbsp;&nbsp;请输入公告信息...." ></textarea>
    						<p><input type="button" value="发布" onclick = "saveNotice()"></p>
    					</form>
    				</div>
    			</div>
    		</div>
    	</section>
    	
    	<div class="smallas"></div>
    </body>
    <script>
    var tareas=document.getElementById('tarea');
    function fabu(){
    	var areas=tareas.value;
    	var pat=/\s/;
    	var val=true;
    	if(areas==''||pat.test('areas')){
    		alert('请输入公告内容！');
    		val=val&&false;
    	}
    	return val;
    }
    
    function saveNotice(){
		
    	var notice_text = $("#tarea").val();
    	   	
    	var usdata = {notice_text:notice_text,};
    	$.ajax({
			type:"post",
			url:"<%=basePath %>notice/save.action",
			data:usdata,
			success:function(data){
				alert(data);
				if(data == "新增成功"){
					location.href="<%=basePath %>notice/page.action";
				}
			},
			error:function(e){
				alert("发生未知错误请刷新页面");
			}
   		 });
	}
    function ind(){
    	window.location.href= "../notice/findByAll.action";
    }
    
   
    </script>
</html>